<form class="layui-form" lay-filter="member-group-add-form" id="member-group-add-form" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" lay-reqText="名称不能为空" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">折扣比例</label>
        <div class="layui-input-block">
            <input type="text" name="pct" lay-verify="pct" autocomplete="off" class="layui-input" placeholder="0-100的整数单位n%，不打折请填写100">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="hidden" name="id" value="">
            <input type="button" lay-submit lay-filter="member-group-add-form-submit" value="确认" class="layui-btn">
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script>
    layui.use(['form'], function () {
        var form = layui.form;
        form.verify({
            pct: [
                /^100$|^(\d|[1-9]\d)$/
                , '折扣比例只能是0-100的整数'
            ]
        });
    })
</script>